package kr.hkit.otherjavawork;

import java.util.Scanner;

public class Reverse {
	Scanner input = new Scanner(System.in);
	
	public void reverseOperation(int aInteger)
	{
		int x= 1;
		System.out.print("위 정수의 자리 수를 입력해주세요 : ");
		int y = input.nextInt();
		int cipher = 1;
		for(int j = 1; j < y; j++)
		{
			cipher = cipher * 10;
		}
		int total = 0;
		do
		{
			total = total + (((aInteger / x) % 10)*cipher);
			x = x * 10;
			cipher = cipher/10;
		}while(aInteger > x);
		System.out.println("역순 한 결과는 "+total);
	}
}
